import axios from "@/common/axios";
import { API_URL } from "@/common/constants";

export const queryCompDangerList = async (json) => {
  let { data } = await axios.post(API_URL + "rCompDangerApi/queryCompDangerList", json);
  return data;
};

export const exportCompDanger = async (json) => {
  let { data } = await axios.post(API_URL + "rCompDangerApi/exportCompDanger", json, {
    headers: { 'Content-Type': 'application/json;charset=UTF-8' },
    responseType: 'blob'
  });

  return data;
};

export const updateCompDanger = async (json) => {
  let { data } = await axios.post(API_URL + "rCompDangerApi/updateCompDanger", json);
  return data;
};


export const addCompDanger = async (json) => {
  let { data } = await axios.post(API_URL + "rCompDangerApi/addCompDanger", json);
  return data;
};



export const delCompDanger = async (json) => {
  let { data } = await axios.post(API_URL + "rCompDangerApi/delCompDanger", json);
  return data;
};


export const importExcel = async (formData) => {
  let { data } = await axios.post(API_URL + "rCompDangerApi/importExcel", formData, {
    headers: {
      'Content-Type': 'multipart/form-data;charset=utf-8'
    }
  });
  return data;

}